2.1

Column

  1. Use the help function to explore what the series gold, woolyrnq and gas represent.
    1. Use autoplot() to plot each of these in separate plots.
    2. What is the frequency of each series? Hint: apply the frequency() function.
    3. Use which.max() to spot the outlier in the gold series. Which observation was it?

1. help(gold)

Description:

Daily morning gold prices in US dollars. 1 January 1985 – 31 March 1989.

Usage:

gold

Format:

Time series data

Examples:

b. frequency(gold)

Frequency: 1

c. which.max(gold)

770

Column

tsdisplay(gold)

a. autoplot(gold)

2.1 cont.

Column

1. help(woolyrnq)

Description:

Quarterly production of woollen yarn in Australia: tonnes. Mar 1965 – Sep 1994.

Usage:

woolyrnq

Format:

Time series data

Examples:

b. frequency(woolyrnq)

Frequency: 4

Column

tsdisplay(woolyrnq)

a. autoplot(woolyrnq)

2.1 cont.

Column

1. help(gas)

Description:

Daily morning gas prices in US dollars. 1 January 1985 – 31 March 1989.

Usage:

gas

Format:

Time series data

Examples:

b. frequency(gas)

Frequency: 12

Column

tsdisplay(gas)

a. autoplot(gas)

2.3 a. & b.

Column

2.3 Download some monthly Australian retail data from the book website. These represent retail sales in various categories for different Australian states, and are stored in a MS-Excel file.

  1. You can read the data into R with the following script:

Column

b. Select one of the time series as follows (but replace the column name with your own chosen column):

First Five Values: 50.4, 49.9, 48, 48.6, 51.3

2.3 c.

Column

c. Explore your chosen retail time series using the following functions:

  • autoplot()
  • ggseasonplot()
  • ggsubseriesplot()
  • gglagplot()
  • ggAcf()

autoplot( )

Column

c.ggseasonplot()

2.3 c cont.

Column

c. ggsubseriesplot()

Column

c. ggAcf()

2.3 c cont.

Column

c.gglagplot()

Column

Interpretation

Can you spot any seasonality, cyclicity and trend?

Seasonality: There is obvious seasonality apparent even in the autoplot, but this is confirmed in the ggsubseriesplot() and ggseasonplot(). There are distinct areas of high and low values that are definitely periodic in nature around the 12 month period, a yearly cycle.

Cyclicity: Cyclicity is harder to nail down, although you can clearly see in the autoplot() and ggsubseriesplot() that some of the sub-series are rising and falling for a number of seasons without relation to the season itself.

Trend:

There is no clear singular trend which is obvious from any of these plots. There are cycles which reflect micro-trends,which you can see in both theautoplot() and the ggsubseriesplot() but not a singular continuous trend throughout the entire data. It may be that there was an upward trend happening which was interupted by an external event forcing the cycles we are seeing, which otherwise might have been an upward trend.

note The lag plots are very hard to read due to so many periods and years of data. It does appear that at the 12 position the data are the most concentrated and linear, but it is not easy to read in this particular case

What do you learn about the series?

This is clearly a series of data points with notable seasonality and possible tendencies toward a trend, however the trend my be interupted by periods of market instability or extreme changes in consumer behavior toward printed materials.